package service.impl;

import dao.TaxDao;
import service.PricingService;
import util.DaoFactory;

public class PricingServiceImpl implements PricingService{

	@Override
	public double pricing(double basePrice, String productName)
			throws Exception {
		double price=-1;
		TaxDao dao=DaoFactory.getInstance(TaxDao.class);
		double taxRate=dao.getTaxRate(productName);
		if(taxRate!=-1){
			price=basePrice*(1+taxRate);
		}
		return price;
	}

}
